# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-config
pkgver=1.1.0
pkgrel=0
pkgdesc="Tools to configure LXQt and the underlying operating system"
url="https://github.com/lxqt/lxqt-config"
arch="all !armhf" # armhf blocked by libkscreen, liblxqt and kwindowsystem
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai libxcursor-dev lxqt-build-tools qt5-qtbase-dev
	qt5-qttools-dev qt5-qtx11extras-dev xf86-input-libinput-dev
	libxi-dev libudev-zero-dev libqtxdg-dev liblxqt-dev
	libkscreen-dev kwindowsystem-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-config/releases/download/$pkgver/lxqt-config-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname
}

sha512sums="
f0272737c5127492f9cd560a831720a7df6ced326109739fcd0f429c45f8d62e4685c438424c5efe4f4927339de7a5f6849560ee5f9901768db5d8511406bb21  lxqt-config-1.1.0.tar.xz
"
